/*
 * File:    WriteFuture.java
 * Created: 15-Nov-2007
 * 
 * by Kenji Hollis <kenji@bitgatesoftware.com>
 * Released under the Creative Commons License version 2.5
 */

package com.bitgate.util.socket;

/**
 * This interface is used to work as a callback when a write function is completed in sending data back to a connected
 * client.
 * 
 * @author kenji
 * @since 0.6.1
 */
public interface WriteFuture
{
	
	/**
	 * This function is called when the write completes.
	 */
	void onComplete();
	
	/**
	 * Increases the number of bytes that were written for this session.
	 * 
	 * @param bytesWritten The number of bytes that were written.
	 */
	void increaseByteCount(int bytesWritten);
	
	/** 
	 * Clears the byte written counter.
	 */
	void clearByteCount();
	
	/**
	 * Returns the number of bytes written.
	 * 
	 * @return <code>int</code> containing the number of bytes written.
	 */
	int getByteCount();
	
}